$(function(){
	$("#back").click(function(){
		window.location.href="../";
	})
})

$(function(){
	$("#runGo").click(function(){
		var Username=$("#Username").val();
		var Password=$("#Password").val();;
		var feeback=$("#feedback");
		if(Username==""){
			feeback.html("请输入用户名！");
		}else if(Password==""){
			feeback.html("请输入密码！");
		}else{
			$.ajax({
				type:"POST",
				url:"http://pads.nenu.edu.cn:8080/suggestions/admin/page/teacher/login.php",
				dataType:"json",
				data:{
					account:Username,
					psw:Password
				},
				success:function(x,y,z){
					if(x.key=="success"){
						$("#feedback").html("");
						localStorage.setItem("ayadmin","taisadmin");
						localStorage.setItem("Username",Username);
						window.location.href="./manage.html";
					}else{
						feedback.html("用户名或者密码错误！");
					}
				},
				error:function(jqXHR){
				    console.log("发生错误"+jqXHR.status);
				}
			});
		}
	})
})